package self.wargon.springcloudstu.servicea.service;

import io.github.resilience4j.retry.event.RetryEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class RetryEventListener {

    @EventListener
    public void onRetryEvent(RetryEvent event) {
        log.info("触发重试 - 重试次数: {}, 异常: {}",
                event.getNumberOfRetryAttempts(),
                event.getLastThrowable().getMessage());
    }
}
